package com.admin;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
//事务管理
@EnableTransactionManagement
//统一配置mapper，省略*Mapper.java中@Mapper注解
@MapperScan(value = {"com.admin.**.mapper", "com.vframework.**.mapper"})
@ComponentScan(value= {"com.admin", "com.vframework"})
public class EshopApplication {
    private static final Logger logger = LoggerFactory.getLogger(EshopApplication.class);
    public static void main(String[] args) {
        SpringApplication.run(EshopApplication.class, args);
        StringBuilder sb = new StringBuilder();
        sb.append("\n========================启动完毕========================\n")
                .append("Swagger文档: http://").append("localhost").append(":8081").append("/doc.html").append("\n")
                .append("Swagger文档: http://").append("localhost").append(":8081").append("/swagger-ui.html").append("\n")
                .append("管理后台访问地址: http://").append("localhost").append(":8081").append("/admin/").append("\n")
                .append("api接口访问地址: http://").append("localhost").append(":8081").append("/api/").append("\n")
                .append("登录地址: http://").append("localhost").append(":8081").append("/login")
                .append("\n========================启动完毕========================");
        logger.info(sb.toString());
    }
}
